<?php 
require_once("../include/conn.php");
require_once("../include/page.php");
$table=$tb_lk;
$page=$_GET['page'];
$perpage=20;
$sql_all="select count(*) from   $table ";
$con   =   mysql_db_query($db_name,$sql_all);   
$num   =   mysql_result($con,0);   //   统计当前总的记录数   
$list=new page($num,$page,$perpage);  
$strartrow=$list->getStartRow();
$sql   =   "select   *   from    $table  order  by   id   DESC   limit $strartrow,$perpage";   //从上面的起点开始查询出20条数据   
$cn_ma   =   mysql_db_query($db_name,$sql);
?>
<html>
<head>
<title>链接管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%"  border="0" cellpadding="0" cellspacing="2">
  <tr class="topbg">
    <th colspan="7">链接管理</th>
  </tr>
  <tr>
   <td width="5%">&nbsp;</td>
    <td width="31%">&nbsp;</td>
   <td width="7%">&nbsp;</td>
    <td width="6%">&nbsp;</td>
    <td width="7%">&nbsp;</td>
    <td width="27%">&nbsp;</td>
    <td width="17%">&nbsp;</td>
  </tr>
  <tr class="tdbg">
  	<td>序号</td>
    <td>标题</td>
	<td>是否显示</td>
	<td>类别</td>
	<td width="7%">有无图片</td>
    <td width="27%">链接地址</td>
    <td width="17%">操作</td>
  </tr>
  <?php
  $i=1;
   while($row_ma = mysql_fetch_array($cn_ma))
   {	
	?>
  <tr class="tdbg">
    <td><?php echo $i; ?></td>
    <td><?php echo $row_ma[name]; ?></td>
	<td><?php 
	if($row_ma[isshow]==1) echo "显示";	
	else  echo "不显示";
	
	?></td>
	<td><?php 
	if($row_ma[leid]==1) echo "图形";	
	else  echo "文字";
	
	?></td>
	<td class="redtxt" ><?php 
	if(strlen($row_ma[pic])>20) echo "有";	
	else  echo "无";
	
	?></td>
    <td><?php echo $row_ma[url]; ?></td>
    <td><a href="link_update.php?id=<?=$row_ma[id];?>">修改</a>&nbsp;&nbsp;&nbsp;<a href="link_ok.php?id=<?=$row_ma[id];?>&action=pack" title="千万要注意哟,删除了就找不回来了!">永久删除</a>&nbsp;&nbsp;&nbsp;</td>
  </tr>
    <?php
	$i++;
	 }?>
  
  <tr  align="center">
    <td colspan="7" style="font-size:20px;"><?php echo $list->showPageList()?> </td>
  </tr>  
</table>
</body>
</html>
